package 力扣日常刷题.木23一月.第08天308;

/**
 * @author 帅小伙
 * @date 2022/3/8
 * @description
 */
public class Demo25旋转数组的最小数字 {

    public int minArray(int[] numbers) {
        int l = 0 ,r = numbers.length - 1;

        while(l < r) {
            int mid = (l + r) >> 1;

            if(numbers[mid] < numbers[r]) {
                r = mid;
            }else if(numbers[mid] > numbers[r]){
                l = mid + 1;
            }else {
                r--;
            }
        }
        return numbers[l];
    }



}
